' 🟠🟠🟠 REMARKS
' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2023.12.16.16.28]) on 2024.04.08 at 21:45 (Coordinated Universal Time)
' This BAM program by Charlie Veniot is a port and mod
' of the BBC BASIC port by Richard Russell (code in comments below the BAM program)
' of the Commodore Plus/4 "COIN-TAIL" program by Georgios Patsos (https://youtu.be/45nWwtf5iOs?si=QGLfRW27wmxpHGWD)

' 🟠🟠🟠 MAIN PROGRAM

SCREEN _NEWIMAGE(1160,700,17)
OPTION BASE 1

➔DrawCycleStart:
   10 COLOR INT(RND*62+1) : f4_color% = INT(RND*62 + 1)
   20 DIM YA(4),XX(4),YY(4),XY(4),YX(4)
   30 XX(2)=0.98:XY(2)=-.97:YX(2)=.09:YY(2)=.96:YA(2) = 1.7
   40 XX(4)=-.15:XY(4)=.28:YX(4)=.26:YY(4)=.24:YA(4) = .44
   60 X=0:Y=0
   70 FOR I=1 TO 100000
   80 R=RND()*100-1
   90 IF R<1 THEN F=1 ELSE IF R<86 THEN F=2 ELSE IF R<93 THEN F=3 ELSE F=4
  100 X=XX(F) * X + XY(F) * Y : Y = YX(F) * X +YY(F) * Y : Y = Y + YA(F)
  110 IF F = 4 THEN CIRCLE (950+X*24,280+Y*52),1,f4_color% ELSE PLOT (950+X*24,280+Y*52)
  115 IF I MOD 1500 = 0 THEN SLEEP 0.01
  120 NEXT I
GOTO ➔DrawCycleStart 

' 🟠🟠🟠 BBC BASIC PROGRAM BY RICHARD RUSSELL
' 10 MODE 9
' 20 DIM Y(4),XX(4),YY(4),XY(4),YX(4)
' 30 XX(2)=.98:XY(2)=-.97:YX(2)=.09:YY(2)=.96:Y(2) = 1.7
' 40 XX(4)=-.15:XY(4)=.28:YX(4)=.26:YY(4)=.24:Y(4) = .44
' 50 COLOUR 4,11
' 60 X=0:Y=0
' 70 FOR I=1 TO 100000
' 80 R=RND(100)-1
' 90 IF R<1 THEN F=1 ELSE IF R<86 THEN F=2 ELSE IF R<93 THEN F=3 ELSE F=4
' 100 X=XX(F)*X+XY(F)*Y:Y=YX(F)*X+YY(F)*Y:Y=Y+Y(F):GCOL F
' 110 PLOT 1000+X*24,480+Y*52
' 120 NEXT I